﻿CREATE TABLE [dbo].[ZweckMatch] (
    [ZweckMatchID]   INT           IDENTITY (1, 1) NOT NULL,
    [MatchID]        INT           NOT NULL,
    [MatchString]    VARCHAR (255) NOT NULL,
    [JahresOffset]   VARCHAR (3)   NULL,
    [QuartalsOffset] VARCHAR (2)   NULL,
    [istGleitend]    VARCHAR (1)   NULL,
    CONSTRAINT [PK_tblZweckMatch] PRIMARY KEY CLUSTERED ([ZweckMatchID] ASC),
    CONSTRAINT [FK_tblZweckMatch_tblZweck] FOREIGN KEY ([MatchID]) REFERENCES [dbo].[dim_Zweck] ([ZweckID])
);


GO
CREATE UNIQUE NONCLUSTERED INDEX [ix_MatchID_MatchString_unique]
    ON [dbo].[ZweckMatch]([MatchID] ASC, [MatchString] ASC);

